package xdu.lz.stage2_design_pattern.chapter10_up_down_context_pattern;

public class QueryFromHttpAction {

    public void execute(Context context){
        try {
            Thread.sleep(100);
            String name = context.getName();
            String cardId = getCardIdByName(name);
            context.setCardId(cardId);

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private String getCardIdByName(String name){
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "320721...."+Thread.currentThread().getId();
    }
}
